package com.bjnangle.nangletool;

import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;

/**
 * Created by YFB on 2017/9/1.
 */

public class AboutActivity extends BaseActivity{
    private TextView tvTitle;
    private String versionCode;
    private TextView tvVCode,tvDisplay,tvSysVCode;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about);
        setActivity(this);
        ivGoBack = (ImageView)findViewById(R.id.btn_back);
        tvTitle = (TextView)findViewById(R.id.tv_title);
        tvTitle.setText("关于");
        tvVCode = (TextView)findViewById(R.id.vcode) ;
        tvDisplay = (TextView)findViewById(R.id.display);
        tvSysVCode = (TextView)findViewById(R.id.vSysCode);

        PackageManager manager = getPackageManager();
        try {
            PackageInfo info = manager.getPackageInfo(getPackageName(),0);
            versionCode = info.versionName;
            tvVCode.setText(""+versionCode);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
        WindowManager wm = this.getWindowManager();

        int width = wm.getDefaultDisplay().getWidth();
        int height = wm.getDefaultDisplay().getHeight();
        tvDisplay.setText(width+" x "+height);
        tvSysVCode.setText("Android"
                + android.os.Build.VERSION.RELEASE);
    }
}
